using System;
using UnityEngine;

public class MapEntrance : MonoBehaviour
{
	public string nameScene;

	public static event Action<string> OnEnterMapTrigger;

	public static event Action OnExitMapTrigger;

	private void OnTriggerEnter(Collider other)
	{
		if (other.gameObject.layer == 20 && MapEntrance.OnEnterMapTrigger != null)
		{
			MapEntrance.OnEnterMapTrigger(nameScene);
		}
	}

	private void OnTriggerExit(Collider other)
	{
		if (other.gameObject.layer == 20 && MapEntrance.OnExitMapTrigger != null)
		{
			MapEntrance.OnExitMapTrigger();
		}
	}
}
